Most flavours of linux come with the gnu debugger , or gdb to the shell Linux的大部分特色源自于shell的gnu调试器,也称作gdb 。
Gnu debugger manual Gnu调试器手册
The gnu debugger is a very powerful tool in any programmer s arsenal Gnu调试器是所有程序员工具库中的一个功能非常强大的工具。
The addr2line utility provides basic symbolic debugger information , although the gnu debugger uses other methods internally Addr2line工具提供了基本的符号调试信息,不过gnu debugger ( gdb )使用的是其他一些内部方法。
I ve only covered a small subset of what it can do here , to find out more i d encourage you to have a read of the gnu debugger manual pages 在本文中,我只介绍了gdb的一小部分功能。要了解更多知识,建议您阅读gnu调试器手册。
It may use too much memory if you compile and run the gnu debugger , probably because it tends to open a window whenever you step into a program call 如果您编译运行gnu调试器,可能会使用太多内存,或许是因为您进入一个程序呼叫时,它都试图打开一个窗口。
As a crucial embedded development tool , the embedded system debugger is usually used to debug and test embedded software 。 a embedded system debugger consists of a cross debugger and a debugger agent , which characteristic lies in the separation of running environments between the cross debugger and the debuggee and the dependence on the gdb agent in the debug session 。 with the development of embedded technique , various embedded debug techniques continuously advance and all kinds of embedded system debuggers are playing a more and more important role in the embedded software development 。 the gnu debugger , gdb as a tool in the gnu toolkits , is an extremely powerful source - level debugger 。 among gdb ’ s many noteworthy features , its ability to debug programs “ remote ” is fascinating 。 this capability is not only essential when porting gnu tools to a new operation system or microprocessor , but it ’ s also useful for developers who need to debug an embedded system based on a processor that gnu already supports 。 gdb is the preferred solution in embedded development because it provides portable , sophisticated debugging over a broad rang of embedded systems 。 this paper discusses the status quo of various embedded system debuggers ; deeply analyses the overall structure of gdb and the debugging mechanism of gdb based on its source codes ; introduces the gdb ’ s remote debug technique and gdb / mi , which are usually used to develop the gdb - based embedded system debugger 。 then dwells on how to use gdb / mi to develop a gui front and how to use rsp 、 stub and gdbserver to design a debug agent , in order to expatiate on the design method of the gdb - based embedded system debugger 。 in the end , provides a concrete implementation of the gdb - based embedded system debugger of “ embedded simulation development platform ” , the project of the innovation fund for technology based firms 。 这个特性不仅在将gnu工具移植到一个新的操作系统和微处理器的时候很有用,对于想调试一个基于gnu支持的芯片的嵌入式系统的开发人员来说,也是非常有用的。由于gdb提供了在大多数嵌入式系统上的可移植的、复杂的调试功能,它已成为嵌入式开发的首选解决方案。本文讨论了当前的各种嵌入式调试器的现状,结合源代码详细分析了gdb的结构和调试原理,介绍了开发基于gdb的嵌入式系统调试器常用的远程调试技术和gdb / mi接口;然后详细阐述了如何使用gdb / mi开发gdb的图形前端和怎样使用rsp协议、 stub和gdbserver设计一个调试代理,从而较深入地讨论了基于gdb的嵌入式调试器的设计方法;最后,结合国家中小型企业创新基金项目“嵌入式仿真开发平台” ,给出了一个基于gdb的嵌入式系统调试器具体实现。